<layout name="master" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/Css/article_typetag.css"/>
<script src="__PUBLIC__/Admin/Js/Article_typetag.js"></script>
<script type="text/javascript">
    // 分类$标签异步添加地址
</script>
<input type="hidden" id="ajax_stores" value="{:U('Article/ajax_stores')}">
<input type="hidden" id="ajax_del" value="{:U('Article/ajax_del')}">
        <div class="tpl-content-wrapper">
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="#">表单</a></li>
                <li class="am-active">分类&标签</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 分类
                    </div>
                </div>

                <div class="tpl-block">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-12">
                            <div class="am-btn-toolbar" style="margin-bottom:20px;">
                                <div class="am-btn-group am-btn-group-xs">
                                    <a href="javascript:;" data-am-modal="{target: '#my1'}" class="am-btn am-btn-default am-btn-success sub" type="type"><span class="am-icon-plus"></span> 新增</a>
                                </div>
                            </div>
                        </div>
                        
                    </div>

                    <ul id="typeBox" class="tpl-task-list">
                    	<foreach name="data.type" key="k" item="v">
	                        <li>
	                            <div class="task-checkbox">
	                                {$k+1}
	                            </div>
	                            <div class="task-title">
	                                <span class="task-title-sp describe"> {$v.describe} </span>
	                                <a href="javascript:;" class="save" type="type" idi="{$v.type_id}"><span class="label label-sm label-success">{$v.type_name}</span></a> 
                                  <a href="javascript:;" class="del" type="type" idi="{$v.type_id}" ><div class="label label-sm label-danger am-fr">X</div></a>
	                            </div>
	                        </li>
						</foreach>
                    </ul>
                </div>

                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 标签
                    </div>
                </div>

                 <div class="tpl-block">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-12">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <a href="javascript:;" data-am-modal="{target: '#my2'}" class="am-btn am-btn-default am-btn-success sub" type="tag"><span class="am-icon-plus"></span> 新增</a>
                                </div>
                                <div class="am-btn-group am-btn-group-xs">
                                    <a href="javascript:;" class="am-btn am-btn-default am-btn-danger dels"><span class="am-icon-plus"></span> 删除</a>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    <div class="am-form-group" style="margin-top:20px;line-height:35px;">
                        <div id="tagsBox" class="am-u-sm-12">
                        		<foreach name="data.tag" item="v">
                            		<a href="javascript:;" class="save" type="tag" idi="{$v.tag_id}" ><span class="label label-sm label-danger Tag" >{$v.tag_name}</span></a><a href="javascript:;" idi="{$v.tag_id}" type="tag" class="del">&times;</a>
                            	</foreach>
                        </div>
                    </div>
                </div>
            </div>
<!-- 模态框 标签 -->
<div class="am-modal am-modal-prompt" tabindex="-1" id="my1">
  <div class="am-modal-dialog">
    <form  action="{:U('Article/ajax_stores')}" method="post">
        <div class="am-modal-hd">新建分类</div>
          <input type="text" class="am-modal-prompt-input typetag"  id="" placeholder="分类名称"/>
          <textarea class="am-modal-prompt-input describe" name="describe" rows="5" cols="" placeholder="分类描述"></textarea>
          <input type="hidden" class="idi"><!--如果是编辑的话,需要的id-->
        <div class="am-modal-footer">
          <span class="am-modal-btn" data-am-modal-cancel>取消</span>
          <botton type="submit" class="am-modal-btn Submit" types="type" data-am-modal-confirm>提交</button>
        </div>
    </form>
  </div>
</div>


<!-- 模态框 标签 -->
<div class="am-modal am-modal-prompt" tabindex="-1" id="my2">

  <div class="am-modal-dialog">

    <div class="am-modal-hd">新建标签</div>
      <p>如果输入多个需要用 | 号隔开.</p>
      <input type="text" class="am-modal-prompt-input typetag"  placeholder="PHP|HTML|CSS|JS......">
      <input type="hidden" class="idi"><!--如果是编辑的话,需要的id-->
	  <div class="am-modal-footer">
      	<span class="am-modal-btn" data-am-modal-cancel>取消</span>
      	<span class="am-modal-btn Submit"  types="tag" data-am-modal-confirm>提交</span>
	  </div>
  </div>
</div>

<!-- 模态框 alert -->
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">提示</div>
    <div class="am-modal-bd">
        
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
    </div>
  </div>
</div>

<!-- 删除 -->
<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">提示</div>
    <div class="am-modal-bd">
      你，确定要删除这条记录吗？
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-cancel>取消</span>
      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
    </div>
  </div>
</div>